home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / cool.lha / lice / misc / defs / defs.h next >
Encoding:
C/C++ Source or Header  |  1991-09-04  |  1.7 KB  |  64 lines

  1. //
  2. //
  3. // Copyright (C) 1991 Texas Instruments Incorporated.
  4. //
  5. // Permission is granted to any individual or institution to use, copy, modify,
  6. // and distribute this software, provided that this complete copyright and
  7. // permission notice is maintained, intact, in all copies and supporting
  8. // documentation.
  9. //
  10. // Texas Instruments Incorporated provides this software "as is" without
  11. // express or implied warranty.
  12. //
  13. // This file contains common definitions, macros, and constants used by header
  14. // and source files under ICE.
  15. //
  16.  
  17. #ifndef DEFSH                    // If no defs header file
  18. #define DEFSH
  19.  
  20. #ifndef BOOLEANH                // If Boolean type not defined
  21. #define BOOLEANH
  22. typedef int Boolean;                // Define Boolean data type
  23. #endif
  24.  
  25. #undef TRUE                    // ensure TRUE is defined
  26. #define TRUE (1)
  27.  
  28. #undef FALSE                    // ensure FALSE is defined
  29. #define FALSE (0)
  30.  
  31. #undef NULL                    // ensure NULL is defined
  32. #define NULL 0
  33.  
  34. #ifndef __cplusplus
  35. overload min;
  36. overload max;
  37. #endif
  38.  
  39. #if defined(DOS)
  40. extern "C" {
  41. #include <stdlib.h>        // include the standard c library
  42. }
  43. #else
  44. // min --  Return the minimum of two long integers
  45. // Input:  Two long integers
  46. // Output: Smallest of two longs
  47.  
  48. inline char min (char a, char b) {return (a < b) ? a : b;}
  49. inline int min (int a, int b) {return (a < b) ? a : b;}
  50. inline long min (long a, long b) {return (a < b) ? a : b;}
  51. inline double min (double a, double b) {return (a < b) ? a : b;}
  52.  
  53. // max --  Return the maximum of two long integers
  54. // Input:  Two long integers
  55. // Output: Largest of two longs
  56.  
  57. inline char max(char a, char b) {return (a > b) ? a : b;}
  58. inline int max(int a, int b) {return (a > b) ? a : b;}
  59. inline long max(long a, long b) {return (a > b) ? a : b;}
  60. inline double max(double a, double b) {return (a > b) ? a : b;}
  61. #endif
  62.  
  63. #endif DEFSH                // End #ifdef
  64.